package com.lin.controller;

import com.lin.service.DirectionService;
import com.lzl.request.ForecastPriceDTO;
import com.lzl.responese.DirectionResponese;
import com.lzl.responese.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * //TODO
 *
 * @author zhaolinlin
 * @description //TODO
 * @createTime 2022/8/18 22:06
 */
@RestController
@RequestMapping("/direction")
public class DirectionController {

    @Autowired
    DirectionService directionService;

    @RequestMapping(method = RequestMethod.GET , value = "/driving")
    public ResponseResult<DirectionResponese> driving(@RequestBody ForecastPriceDTO forecastPriceDTO){
        String depLongitude = forecastPriceDTO.getDepLongitude();
        String depLatitude = forecastPriceDTO.getDepLatitude();
        String destLongitude = forecastPriceDTO.getDestLongitude();
        String destLatitude = forecastPriceDTO.getDestLatitude();
       return directionService.driving(depLongitude,depLatitude,destLongitude,destLatitude);
    }
}
